Skip to content

Add support for JShell in repl#4262

Open
Gedochao wants to merge 11 commits into
VirtusLab:mainfrom
Gedochao:feature/jshell
Open

Add support for JShell in repl#4262
Gedochao wants to merge 11 commits into
VirtusLab:mainfrom
Gedochao:feature/jshell

Conversation

@Gedochao
Copy link
Copy Markdown
Contributor

@Gedochao Gedochao commented May 8, 2026

jshell-rec.mov

Note that JShell requires Java 9 or higher.

Some ricochet fixes for Java projects:

  • pure Java projects will now use the default Scala versions for declared Scala dependencies (this enables the usage of Scala Toolkit in JShell, for example)
  • --repl-init-script-file enables to pass --repl-init-script via a file containing the script
    • this is a workaround for making initialization scripts on Windows
    • currently, it's a low effort implementation which pastes the contents of the script into the REPL (enforcing it has to be a JShell script for Jshell and a Scala script for Scala)
    • a possible follow-up could add extra handling for those scripts (like validation of contents for a given REPL), but I consider it out of scope for this PR

Checklist

  • tested the solution locally and it works
  • ran the code formatter (scala-cli fmt .)
  • ran scalafix (./mill -i __.fix)
  • ran reference docs auto-generation (./mill -i 'generate-reference-doc[]'.run)

How much have your relied on LLM-based tools in this contribution?

Extensively, Cursor + Claude

How was the solution tested?

new automated tests

@Gedochao Gedochao force-pushed the feature/jshell branch 2 times, most recently from 1854bc0 to 3407e02 Compare May 13, 2026 13:29
@Gedochao Gedochao force-pushed the feature/jshell branch 2 times, most recently from e5545ae to 9ba65cd Compare May 18, 2026 14:52
@Gedochao Gedochao changed the title [WIP] Add support for JSHELL in repl Add support for JShell in repl May 19, 2026
@Gedochao Gedochao added the needs squashing This PR should be squashed before merging. label May 19, 2026
@Gedochao Gedochao marked this pull request as ready for review May 19, 2026 12:41
@Gedochao Gedochao requested review from tgodzik and zielinsky May 19, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs squashing This PR should be squashed before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant